package io.xccit.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.xccit.common.result.AjaxResult;
import io.xccit.model.system.SysPost;
import io.xccit.model.vo.SysPostQueryVo;
import io.xccit.system.service.ISysPostService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author CH_ywx
 * @date 2023-06-28
 * @description
 */
@Api(tags = "岗位管理")
@RestController
@CrossOrigin
@RequestMapping("/api/system/sysPost")
public class ISysPostController {

    @Resource
    private ISysPostService sysPostService;

    @ApiOperation("岗位分页条件查询")
    @GetMapping("/{pageNo}/{pageSize}")
    public AjaxResult<IPage<SysPost>> selectPage(@ApiParam(value = "当前页",required = true) @PathVariable Long pageNo,
                                                 @ApiParam(value = "每页条数",required = true) @PathVariable Long pageSize,
                                                 @ApiParam("条件查询封装体") SysPostQueryVo sysPostQueryVo){
        Page<SysPost> sysPostPage = new Page<>(pageNo,pageSize);
        IPage<SysPost> result = sysPostService.selectPage(sysPostPage,sysPostQueryVo);
        return AjaxResult.ok(result);
    }

}
